-module('ex_8.20_block_node_types').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        77,
        true,
        [],
        0,
        78,
        7,
        1,
        false,
        6,
        12,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        19,
        17,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,6,12},
          {yamerl_doc_end,6,12},
          {yamerl_collection_end,6,12,block,sequence},
          {yamerl_collection_end,6,12,block,mapping},
          {yamerl_scalar,6,9,
            {yamerl_tag,6,9,{non_specific,"?"}},
            flow,plain,"bar"},
          {yamerl_mapping_value,6,7},
          {yamerl_scalar,6,3,
            {yamerl_tag,6,3,{non_specific,"?"}},
            flow,plain,"foo"},
          {yamerl_mapping_key,6,3},
          {yamerl_collection_start,6,3,
            {yamerl_tag,5,3,"tag:yaml.org,2002:map"},
            block,mapping},
          {yamerl_sequence_entry,5,1},
          {yamerl_scalar,3,3,
            {yamerl_tag,3,3,{non_specific,"!"}},
            block,folded,"Block scalar\n"},
          {yamerl_sequence_entry,3,1},
          {yamerl_scalar,2,3,
            {yamerl_tag,2,3,{non_specific,"!"}},
            flow,double_quoted,"flow in block"},
          {yamerl_sequence_entry,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,sequence},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
